<?php
    session_start();     
    
?>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>index</title>
	<style>
</style>
    <script src="./js/jquery-3.2.1.min.js"></script>
 <link rel="stylesheet" type="text/css" href="./css/index.css">
 <link rel="stylesheet" href="./assets/css/amazeui.min.css">
 <link rel="stylesheet" href="./assets/css/app.css">

</head>
<body>
	<div id="header">
		<div class="top_a">
		    <div class="top_logo">
        </div>
		<div class="top_location">
	<!-- 		<div class="city_name_box">
			<span class="address"></span>
			<span class="curr_city_name">东莞市</span>
			</div>
			<div class="city_wrapper">
				<div class="curr_city">
					<span class="city_name">切换城市</span>
				</div>
           <div class="header_city_box">
           	<div class="search_city">
           		<label>搜索城市</label>
           		<div class="searchcmp">
           			<input type="text" placeholder="请输入城市名" class="searchinput">
           		</div>
           	</div>
           	 <div class="hot_city">
           	 	<label>热门城市</label>
           	 	<ul>
           	 		<li>深圳市</li>
           	 		<li>上海市</li>
           	 		<li>广州市</li>
           	 		<li>北京市</li>
           	 		<li>重庆市</li>
           	 		<li>天津市</li>
           	 	</ul>
           	 </div>
           	 <hr>
           	 <h1>选择区域</h1>
           	   <div class="chose_address">
           	   	<input type="hidden" name="sanji">
           	   	<input type="hidden" name="province" data-province-name="广东省">
           	   <input id="deliveryRegionalismRefer" name="city" type="hidden" data-city-name="东莞市">
           	   <div class="s-p">
           	   	<div class="value">广东省</div>
           	   </div>
           	   <div class="s-c">
           	   	<div class="value_placeholder">"请选择"</div>
           	   </div>
           	   <div class="s-d">
           	   	<div class="value placeholder">请选择</div>
           	   </div>
           	   </div>
           	   <div class="tips">
                温馨提示：若购买中更换收货城市，可能导致购物车内容均被清空！
                </div>
            </div>
			</div> -->
		</div>
		    <div class="top_nav">
			       <a class="cake" href="#">蛋糕</a>
			       <a class="afternoontea" href="#">下午茶</a>
			       <a class="freehand" href="#">手信</a>
			       <a class="groupbuys" href="#">团购预约</a>
			       <a class="aboutus" href="#">关于我们</a>
		    </div>
		<div class="tool_box">
			<a class="sarch" onclick="sarch_box()" href="#"><img src="./images/sarch.gif"></a>
			<a class="shoppingcar" href="#"><img src="./images/shoppingcar.gif"></a>
				<a class="usernologin" href="javascript:;" data-am-offcanvas="{target: '#doc-oc-demo3'}"><img src="./images/home.gif"></a>
					<a href="#"><img src="./images/right.gif"></a>
          <div id="mse_user_ident">
               <?php
                  $tab=".user-login";
                   if(isset($_SESSION['userName'])){
                       echo $tab;
                   } else {
                    $tac=".usernologin";
                       echo $tac;
                   }
               ?>
           </div>

          <div class="user-login" data-am-dropdown>
            <button class="am-btn am-btn-primary am-dropdown-toggle" data-am-dropdown-toggle>幸福用户1232 <span class="          am-icon-caret-down"></span></button>
            <ul class="am-dropdown-content">
              <li><a href="#">我的幸福</a></li>
              <li><a href="#">退出登录</a></li>
            </ul>
          </div>







		</div>
	</div>
	</div>
        <!-- 侧边栏内容 -->
        <div id="doc-oc-demo3" class="am-offcanvas">
        <div class="am-offcanvas-bar am-offcanvas-bar-flip">
        <div class="am-offcanvas-content">
        <header id="header_box_login">
    <div id="hbl_right">
      <a href="javascript:;" data-rel="close" class="doc-oc-js"></a>
    </div>
  </header>
  <div class="login_main_box" style="position: relative;">
     <div id="title">账户登录</div>
     <form action="../api/userLoginApi.php" method="post">
       <div class="login">
       <div class="user">
        <div class="lg_user">
          <input type="text" name="username" id="username" placeholder="手机号码">
        </div>
        <div class="lg_password">
          <input type="text" name="password" id="password" placeholder="密码">
        </div>
       </div>  
       <label class="checkbox-wrap" for="remember-me">
      <input id="remember-me" name="remember-me" type="checkbox">&nbsp;记住我
      </label>
       <a href="#" class="find_password">忘记密码</a>
       <input type="submit" class="loginbtn" id="login_btn_1" name="login_btn_1" value="登录" />
       <a href="javascript:;"  onclick="numlogin_show()" class="phonenum_login">手机快捷登录</a>
       <a href="javascript:;" onclick="zhuce_show()" class="zhuce">注册新账号</a>
      </div> 
    </form>
      </div>
      
 </div>

  <div class="numlogin_main_box" style="position: relative;display: none;">
     <div id="title">手机快捷登录登录</div>
     <form action="../api/userLoginApi.php" method="post">
       <div class="numlogin">
       <div class="user">
        <div class="lg_user">
          <input type="text" name="username" id="username" placeholder="手机号码">
        </div>
        <div class="lg_code">
          <input type="text" name="code" id="code" placeholder="验证码" >
          <input type="submit" name="get_code" id="get_code" class="getcode" value="获取验证码"/>
        </div>
       </div>  
       <label class="checkbox-wrap" for="remember-me">
      <input id="remember-me" name="remember-me" type="checkbox">&nbsp;记住我
      </label>
       <input type="submit" class="loginbtn" id="login_btn_2" name="login_btn_2" value="登录" />
       <a href="javascript:;" onclick="login_show()" class="user_login">账户登录</a>
       <a href="javascript:;"  onclick="zhuce_show()" class="zhuce">注册新账号</a>
      </div>
      </div>
       </form>
   

  <div class="zhuce_main_box" style="position: relative;display:none;">
    <form action="../api/userRegApi.php" method="post">
     <div id="title">注册新账户</div>
       <div class="zhuce">
        <div class="zhuce_user">
          <input type="text" name="username" id="username" placeholder="请输入手机号码">
          <input type="text" name="password" id="password" placeholder="请输入密码">
          <input type="text" name="ag_password" id="ag_password" placeholder="请再次输入密码">
          <input type="text" name="input_code" id="input_code" placeholder="请输入验证码" value="" onblur="checkCode()">
        </div>
        <div class="zhuce_code">
          <input type="text" name="num_code" id="num_code" placeholder="验证码" >
          <img src="../api/codeApi.php" id="img_code" width="100px;" onclick="this.src='../api/codeApi.php?t='"+Math.random() alt=""/>
          <input type="submit" name="get_code" id="get_code" class="getcode" value="获取验证码"/>
        </div> 
        <input type="submit" class="zhucebtn" id="zhuce_btn" name="zhuce_btn" value="同意协议并注册" />
       <a href="javascript:;"  onclick="login_show()" class="user_login">账户登录</a>
       <a href="javascript:;"  onclick="numlogin_show()" class="num_login">手机快捷登录</a>
      </div>  
    </form>
      </div>
       
 </div>
        
        </div>  
        </div>
        </div>

<section>
<!--   <div class="search-bar">
    <input class="search-input" type="text" >
    <a id="start-search" href="javascript:;" ></a>
  </div> -->
    <div id="picture">
      <li><img src="./images/f_1.jpg"></li>
      <li><img src="./images/f_2.jpg"></li>
      <li><img src="./images/f_3.jpg"></li>
      <li><img src="./images/f_4.jpg"></li>
    </div>
     <script >
          var i=0;
          var t;
          function changeImg(i){
            $("#picture li").eq(i).css('display','block').siblings().css('display','none');
            $("#num_box li").eq(i).removeClass().addClass('red').siblings().removeClass('red').addClass('hui');
          }
          function loop(){
            if (i>4) {i=0};
            changeImg(i);
            t=setTimeout("loop()",2500);
            i++;
          }
          loop()
       
        </script>
  <div class="f3_box">
    <div id="left">
       <img src="./images/index_left.gif">
    </div>
    <div id="middle">
       <img src="./images/index_middle.gif">
    </div>
    <div id="right">
      <img src="./images/index_right.gif">
    </div>
  </div>
  </section>
  <footer>
  <div id="footer" >
  <div class="f1">
    <div class="links first bd"><a href="/brandactivities">品牌动态</a></div>
    <div class="links bd"><a href="/certificate">生产经营资质</a></div>
    <div class="links bd"><a href="/cooperation">企业合作</a></div>
    <div class="links bd"><a href="/applyinvoice">发票申请</a></div>
    <div class="links bd"><a href="/helpserver">帮助服务</a></div>
    <div class="links last"><a href="/contactus">联系我们</a></div>
    <div class="other"> 
      <img src="./images/phone.gif" >
        <i class="icon"></i>
  </div>
  <div class="copy">
    <span>幸福西饼网络商城</span>
    <a href="#" target="_blank">粤ICP备16039394号-1</a>
  </div>
</div>
</div>
</footer>
<script>
   function sarch_box() {
      
   }
</script>
</body>
<!--[if (gte IE 9)|!(IE)]><!-->
<!--<![endif]-->
<script src="./assets/js/amazeui.min.js"></script>
<script>
  $(function() {
    var id = '#doc-oc-demo3';
    var $myOc = $(id);
    $('.doc-oc-js').on('click', function() {
      $myOc.offCanvas($(this).data('rel'));
    });

    $myOc.on('open.offcanvas.amui', function() {
      console.log(id + ' 打开了。');
    }).on('close.offcanvas.amui', function() {
      console.log(id + ' 关闭了。');
    });
  });
</script>
<script>
  function  login_show(){
 $(".login_main_box").css('display','block');
    $(".zhuce_main_box").css('display','none');
    $(".numlogin_main_box").css('display','none');
   }
  function  numlogin_show(){
    $(".login_main_box").css('display','none');
    $(".zhuce_main_box").css('display','none');
    $(".numlogin_main_box").css('display','block');
   } 
  function  zhuce_show(){
    $(".numlogin_main_box").css('display','none');
    $(".login_main_box").css('display','none');
    $(".zhuce_main_box").css('display','block');
   }
   function checkCode(){
    var s=$("#input_code").val();
    if (s.length<1) {alert('请输入验证码');$('#username').focus();return false; }
     $.post('../api/checkCodeApi.php',{input_code:s},function(data){
        if(data=='check_ok'){alert('验证通过')}
          else{alert('验证失败')}
        // alert(data);
     },'html')
   }
  </script>
</html>